<template>
  <el-dialog :title="title" center  :visible.sync="openState" :close-on-click-modal="false" width="900px" append-to-body>
    <div class="discountReceipt-pick-operate-box">
      <div class="operate-box-top">
        <Ht-search-form
          :defaultEventKey="defaultSearchKey"
          :dictMap="dictMap"
          :queryParams="queryParams"
          :outputQueryParams="queryParams"
          :formOptions="formOptions"
          :advOptions="[]"
          :labelWidth="90"
        ></Ht-search-form>
      </div>
      <div class="operate-box-bottom">
        <div class="bottom-content">
          <ht-table
            :defaultEventKey="defaultSearchKey"
            ref="dataTable"
            rowKey="brno"
            :showSerialNumber="false"
            :multi-select="false"
            :dictMap="dictMap"
            :reqConfig="reqConfig"
            :queryParams="queryParams"
            :tableBindColumns="tableBindColumns"
            :showRightToolbar="false"
          >
            <template v-slot:operate>
              <el-table-column
                label="操作"
                align="center"
                fixed="left"
                width="120"
                class-name="small-padding fixed-width"
              >
                <template slot-scope="scope">
                  <ht-button-group
                    :buttonList="[
                      {
                        label: '选择',
                        doFunc: () => {
                          confirm(scope.row);
                        },
                      },
                    ]"
                  />
                </template>
              </el-table-column>
            </template>
          </ht-table>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import { IbpsBankCode } from "@/api/ibps/common/bankInfo";
export default {
  name: "IbpsBankBranchDialog",
  props: {},
  data() {
    return {
      title: "",
      openState: false,
      defaultSearchKey: "ibpsBankSearch-dialog",
      // 来源标识 为了服用区分是哪个选项触发的
      fromFlag: "",
      dictMap: {},
      tableLoadingState: false,
      formOptions: [],
      queryParams: {
        bankCode: "",
        orgFullname: "",
      },
      reqConfig: IbpsBankCode,
      tableBindColumns: [
        { label: `接收方`, prop: "brno", width: 180 },
        { label: `接收方所属CCPC`, prop: "bankCenter", width: 200 },
        { label: `接收方名称`, prop: "brname", width: 400 },
      ],
      refName: ''
    };
  },
  mounted() {
    const formOptions = [
      {
        type: "input",
        prop: "brno",
        defaultAttr: {
          size: "small",
          label: "接收方",
          placeholder: "请输入接收方",
        },
      },
      {
        type: "input",
        prop: "brname",
        defaultAttr: {
          size: "small",
          label: "接收方名称",
          placeholder: "请输入接收方名称",
        },
      },
    ];
    this.formOptions = formOptions;
  },
  methods: {
    show(fromFlag = "",refName = '') {
      this.openState = true;
      this.fromFlag = fromFlag;
      this.refName = refName
    },
    close() {
      this.openState = false;
    },
    loadData() {},
    // 点击确认数据
    confirm(row) {
      this.$emit("confirm", this.fromFlag, row, this.refName);
      this.openState = false;
    },
  },
};
</script>
<style scoped></style>
